<template>
  <div class="hello">
    <ul>
      <li>
        <input type="text" v-model="name">

      </li>
      <li>
        <input type="password" v-model="password">
      </li>
      <li>
        <input type="text" v-model="validateCode">
        <img :src="src" @click="code">
      </li>
      <li>
        <a @click="login">登录</a>
      </li>
      <li>
        <el-button>默认按钮</el-button>
<el-button type="primary">主要按钮</el-button>
<el-button type="text">文字按钮</el-button>
      </li>
      <li>
        <actionsheet v-model="show1" :menus="menus1" @on-click-menu="click"></actionsheet>
      </li>
    </ul>
  </div>
</template>

<script>
import {
    mapActions
} from 'vuex'
import { Button } from 'element-ui'
import { Actionsheet } from 'vux'
export default {
  name: 'hello',
  components:{
    Button,
    Actionsheet
  },
  data () {
    return {
      name: '',
      password: '',
      validateCode: '',
      src:'http://www.sharingschool.net/test_manage/sys/validateCode',
      show1: true,
      menus1: {
        menu1: 'Share to friends',
        menu2: 'Share to timeline'
      },
    }
  },
  mounted() {
    
  },
  methods: {
    ...mapActions(['POST_SYS_AUTH']),
    click (key) {
      console.log(key)
    },
    login(){
      let obj={
        loginName:this.name,
        password:this.password,
        validateCode:this.validateCode
      }
      this.POST_SYS_AUTH(obj).then((data) => {
        console.log('aaaaaaa',data)
      }, (error) => {

      })
    },
    code(){
      this.src=this.src+'?t='+Math.random()
    }
  }
}
</script>
